package com.wss.module.main.ui.main.adapter;

import com.wss.common.base.adapter.BaseListAdapter;
import com.wss.common.base.adapter.listener.OnListItemClickListener;
import com.wss.common.base.adapter.superadapter.SuperViewHolder;
import com.wss.common.bean.Template;
import com.wss.module.main.ResourceTable;
import ohos.app.Context;
import org.jetbrains.annotations.NotNull;

import java.util.List;

public class CaseAdapter extends BaseListAdapter<Template> {

    /**
     * 常规列表重写该方法
     *
     * @param context     context
     * @param list        数据源
     * @param listener    Item点击回调
     */
    public CaseAdapter(Context context, List<Template> list, OnListItemClickListener<Template> listener) {
        super(context, list, ResourceTable.Layout_item_of_case_list, listener);
    }

    @Override
    public void onBindData(@NotNull SuperViewHolder holder, int layoutPosition, @NotNull Template data) {
        holder.setText(ResourceTable.Id_tv_title, data.getTitle());
        holder.setText(ResourceTable.Id_tv_describe, data.getDescribe());
    }
}
